cmake_minimum_required(VERSION 3.16)

project(BaseWidgets LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)

add_library(BaseWidgets SHARED
  BaseWidgets_global.h
  FramelessWidget.cpp
  FramelessWidget.h
  BaseDialog.h BaseDialog.cpp
  BaseDialogWithShadow.h BaseDialogWithShadow.cpp
  BaseMainWidget.h BaseMainWidget.cpp
  SettingWidget.h SettingWidget.cpp
  Setting_General.h Setting_General.cpp
  Setting_Memory.h Setting_Memory.cpp
  Setting_Feedback.h Setting_Feedback.cpp
  Setting_About.h Setting_About.cpp
  UploadPictures.h UploadPictures.cpp
  ImageCell.h ImageCell.cpp
  BasePlainTextEdit.h BasePlainTextEdit.cpp
)

target_link_libraries(BaseWidgets PRIVATE
  Qt${QT_VERSION_MAJOR}::Widgets
)
target_link_directories(BaseWidgets PRIVATE
  ${CMAKE_CURRENT_SOURCE_DIR}/PatientManagerWidget/SettingWidget.*
)

target_compile_definitions(BaseWidgets PRIVATE BASEWIDGETS_LIBRARY)
